using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace AutoBurnerLibrary
{
    /// <summary>
    /// This class describes a file system that is the target of an autoBurn
    /// </summary>
    public class Target
    {

        #region Accessors
        private DirectoryInfo targetDirectory;
	
        #endregion

        #region Constructor
        private Target()
        {
            this.targetDirectory = null;
        }

        private Target(DirectoryInfo directory)
        {
            this.targetDirectory = directory;
        }
        #endregion

        /// <summary>
        /// Creates a new Target object
        /// </summary>
        /// <exception cref="NullReferenceException">Thrown if path is null</exception>
        /// <exception cref="ArgumentException">Thrown if path is an empty string</exception>
        /// <seealso cref="DirectoryInfo"/>
        /// <param name="path">Path of the directory</param>
        /// <returns>Target Object</returns>
        public static Target CreateTarget(string path)
        {
            if (path == null) { throw new NullReferenceException("Path string was null"); }
            if (path.Length < 1) { throw new ArgumentException("Path argument is invalid", "path"); }

            Target target = new Target(new DirectoryInfo(path));
            
            return target;
        }

    }
}
